package com.lhj.bootdemo.designmode.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author lhj
 * @version 1.0
 * @date 2022/5/18 9:10 上午
 * @description:
 */

public class JdkProxy implements InvocationHandler {

    Object target;

    public JdkProxy(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("jdk proxy before");
        Object invoke = method.invoke(target, args);
        System.out.println("jdk proxy before");
        return invoke;
    }

}
